package wqh.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wqh.dao.WaterChannelDao;
import wqh.domain.WaterChannel;
import wqh.service.WaterChannelService;

import java.util.List;

/**
 * Created by devts on 2017/1/5.
 */
@Service("waterChannelService")
public class WaterChannelServiceImpl implements WaterChannelService {

    private final WaterChannelDao dao;

    @Autowired
    public WaterChannelServiceImpl(WaterChannelDao dao) {
        this.dao = dao;
    }

    public void save(WaterChannel entity) {
        this.dao.save(entity);
    }

    public void update(WaterChannel entity) {
        this.dao.update(entity);
    }

    public void delete(WaterChannel entity) {
        this.dao.delete(entity);
    }

    public void deleteAll() {
        this.dao.deleteAll();
    }

    public List<WaterChannel> findAll() {
        return this.dao.findAll();
    }

    public WaterChannel findById(Long id) {
        return this.dao.findById(id);
    }

    @Override
    public WaterChannel findByChannelAndDeviceId(Integer channel_number, Long water_device_id) {
        return this.dao.findByChannelAndDeviceId(channel_number, water_device_id);
    }

    @Override
    public List<WaterChannel> findByGeoId(Long geo_id) {
        return this.dao.findByGeoId(geo_id);
    }
}
